package com.md.api;

import com.md.model.system.CommonResult;
import com.md.request.RegisterUsersRequest;
import com.md.request.open.CheckPermissionRequest;
import com.md.request.open.QuerySimpleUsersRequest;
import com.md.request.open.QueryUsersRequest;
import com.md.response.UsersResponse;
import com.md.response.open.SimpleUsersResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author 刘骄阳
 * @date 6/3/25 11:52 am
 **/
@Api("开放接口-用户")
public interface OpenUsersApi {
  String PATH_PREFIX = "/open/users-center";

  /**
   * 注册用户信息
   *
   * @param request 请求实体
   * @return 操作结果
   */
  @PostMapping(PATH_PREFIX + "/register/users")
  @ApiOperation("注册用户信息")
  CommonResult<UsersResponse> registerUsers(@RequestBody RegisterUsersRequest request);

  /**
   * 查询用户信息
   *
   * @param request 请求实体
   * @return 操作结果
   */
  @PostMapping(PATH_PREFIX + "/query")
  @ApiOperation("查询用户信息")
  CommonResult<UsersResponse> queryUserInfo(@RequestBody QueryUsersRequest request);

  /**
   * 校验权限
   *
   * @return 操作结果
   */
  @PostMapping(PATH_PREFIX + "/check-permission")
  @ApiOperation("校验权限")
  CommonResult<Boolean> checkPermission(@RequestBody CheckPermissionRequest request);

  /**
   * 查询用户简易信息
   *
   * @return 操作结果
   */
  @PostMapping(PATH_PREFIX + "/simple-info")
  @ApiOperation("查询用户简易信息")
  CommonResult<SimpleUsersResponse> simpleInfo(@RequestBody QuerySimpleUsersRequest request);

}
